home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
filutil
/
dp107e.zip
/
CHL.TIM
< prev
next >
Wrap
Text File
|
1995-02-22
|
4KB
|
95 lines
CHL instructions
( Simple instruction to describe symbol )
1) Why CHL ?
There are two ways to draw a symbol.
a) Coding method : Lines of code are written into program to
draw a symbol. The major disadvantage of coding method is
that the program will be very large for each symbol need
a separate routine.
b) Image method : Symbols are store in image files (PCX, BMP,
MSP etc.). User can read in all kinds of symbol by using the
same routine. The disadvantage of image method is that it is
not easy to get a smooth image after enlargement or rotation.
To avoid the above two disadvantages, CHL use vector instructions
to describe a symbol. With Diskpaper, user can read in, rotate,
enlarge, stretch a symbol.
2) Coordinate system of CHL.
CHL is a two dimension vector instruction set. The limitations of X and
Y are from -32000 to 32000.
3) CHL instructions.
A) Parameters.
color/color1/color2/color3 : color to draw.
Fill/Border/Edge : the drawing method, fill the interior or not.
Set/And/Or/Xor(SAOX) : the bits operation of drawing.
B) Instructions.
< : comment line.
SYS : With Diskpaper, SYS will set parameter color, F/B,
and SAOX to the corresponding flags defined in the Diskpaper.
SET : Set parameter SAOX to 'set'.
AND : Set parameter SAOX to 'and'.
OR : Set parameter SAOX to 'or'.
XOR : Set parameter SAOX to 'xor'.
BORDER : Set parameter BFE to 'border'.
FILL : Set parameter BFE to 'fill'.
EDGE : Set parameter BFE to 'edge'.
COLOR COLOR1 COLOR2 COLOR3 : Format as below
i) color1 k
You can define a color for drawing. k can be any value,
but Diskpaper has 7 colors only.
ii) color1 #n n=1,2,3
With Diskpaper, you can set color to Dikpaper's
color1/color2/color3.
LINE : line x1,y1 ; x2,y2 ; x3,y3 ; ..... ; Xn, Yn
Draw an n-points line. You can split one row to a couple of rows.
line x1,y1 ; x2,y2 ; x3,y3 ; ( ; means line continues )
X4,Y4 ; ..... ; Xi,Xi ;
Xl,Yl ; ..... ; Xm,Xm ( line terminate here )
POLY : POLY x1,y1 ; x2,y2 ; x3,y3 ; ..... ; Xn, Yn
3 <= n <= 500
Draw an n-points POLY.
SEC : sec x, y, rx, ry, d0, d1, d2
Draw a sector.
x, y : center point of sector.
rx : radius of x axis.
ry : radius of y axis.
d0 : start point of sector in degree.
d1 : end point of sector in degree.
d2 : rotatation degree.
Note : A full ellipse will be draw, if d0 is equal to d1.
ARC : arc x, y, rx, ry, d0, d1, d2
Draw a arc ( Similar to SEC ).
BEGINPOLY : Beginpoly and endpoly are dual instructions. You can put
ENDPOLY line, arc, sec, poly instructions between them. Those in-
structions after BEGINPOLY will not be draw. All instructions
will be translate and store to a polygon array which has
500 entries. This polygon array will be draw till ENDPOLY
met. One thing is important, the SEC and ARC are translate
to an n-points polygon. To avoid array overflow (500), carefully
use SEC and ARC.
Example.
BEGINPOLY
< Upper large arc
arc 16000,18000,8000,8000,-15,195,0
< Left line
line 9000,14000; 13000,9000; 13000,2000
< Down small arc
arc 16000,2000,3000,3000,180,360,0
< Right line
line 19000,2000; 19000,9000; 23000,14000
ENDPOLY
4) Read CHL file from Diskpaper.
You can select menu function Xin -> CHL and define a rectangle
which maps to (0, 0) and (32000, 32000). Diskpaper will caculate
the ratio of X, Y, rotation degree and draw the Symbol. No error
message will be show, if error found.